﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace snat.model {

    public delegate void windowDelegate();

    public abstract  class WindowedNode : ResettableNode {

        private static object registrationLock = new object();
        private static bool registered = false;
        protected abstract void OnMessageProcessed(Message m);

        public  WindowedNode(int _id, string _name)
            : base(_id, _name) {
            lock (registrationLock) {
                if (!registered) {
                    NetworkModel.Instance.MessageProcessed += OnMessageProcessed;
                    registered = true;
                }
            }
        }
    }
}

